<?php
$iGroupUsers = UsergroupHandler::getUsers($_REQUEST['iUsergroup']);
$oUsers = UserHandler::getUsers();
?>
<div id="layer_usergroup_adduser" class="hidden" style="visibility: visible;">
<form action="index.php" method="post" name="form_usergroup_adduser">
<input type="hidden" name="sAction" value="usergroup-adduser">
<input type="hidden" name="sView" value="usergroup-view">
<input type="hidden" name="iUsergroup" value="<?php print $_REQUEST['iUsergroup'] ?>">
<table class="boxborder" cellspacing="0">
	<tr>
		<td class="boxhandle" colspan="2"><?php print msg('Add user') ?></td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('User') ?>:</td>
		<td class="fieldvalue">
			<select name="iUser" id="focus_usergroup_adduser">
<?php
foreach ($oUsers as $iThisUserID => $oThisUser)
{
	if ($iGroupUsers[$iThisUserID]) {
		continue;
	}
	echo '<option value="'.$iThisUserID.'">'.$oThisUser->sUser.'</option>';
}
?>
			</select>
		</td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('Group admin') ?>:</td>
		<td class="fieldvalue"><input type="checkbox" name="bAdmin"></td>
	</tr>
	<tr>
		<td class="boxbody center" colspan="2">
			<input type="submit" value="<?php print msg('OK') ?>">
			<input type="button" value="<?php print msg('Cancel') ?>" onClick="layerHide('layer_usergroup_adduser');">
		</td>
	</tr>
</table>
</form>
</div>
